package com.Leetcode;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Stack;

/**
 * @author xxy
 * @create 2021/5/8 17:10
 */
class Solution {
    public int lengthOfLastWord(String s) {
       if(s==null||s.isEmpty()){
           return 0;
       }

        String trim = s.trim();
        String[] s1 = trim.split(" ");
        return s1[s1.length-1].length();
    }
}